<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JS DOM</title>
    </head>
    <body>
        <div id="box1">这是一个ID选择器标签</div>
        <div class="box2">这是一个类选择器标签</div>
        <div>普通的div标签</div>

        <script>
            var element_id = document.getElementById("box1");
            console.log(element_id);

            var element_class = document.getElementsByClassName("box2");
            console.log(element_class);

            var element_tag = document.getElementsByTagName("div");
            console.log(element_tag);

            element_id.innerHTML = "修改ID选择器标签文本内容";
            element_class.innerText = "修改类选择器文本";
            
        </script>
    </body>
</html>